import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("2025001","张三","123"));
        students.add(new Student("2025002","李四","456"));
        System.out.println("=== 欢迎进入学生选课系统 ===");
        System.out.print("请输入学号：");
        String id = sc.nextLine();
        System.out.print("请输入密码：");
        String pwd = sc.nextLine();

        Student loginStu = null;
        for(Student s : students){
            if(s.getStuId().equals(id) && s.getPassword().equals(pwd)){
                loginStu = s;
                break;
            }
        }
        if(loginStu == null){
            System.out.println("登录失败，学号或密码错误！");
            return;
        }
        System.out.println("登录成功，欢迎你：" + loginStu.getName());

        while (true){
            System.out.println("\n--- 主菜单 ---");
            System.out.println("1.查看课程列表");
            System.out.println("2.选课");
            System.out.println("3.退出系统");
            System.out.println("请输入选择：");
            int choice = sc.nextInt();

            if(choice == 1){
                System.out.println("暂时还没有课程数据");
            }else if(choice == 2){
                System.out.println("选课功能还在开发中");
            } else if (choice == 3) {
                System.out.println("退出成功！");
                break;
            }else{
                System.out.println("输入有误，请重新选择！");
            }
        }
        sc.close();
    }
}
